package com.xxx.corejava.day1106;

public class Test2 {

    //Java中方法参数传递的是栈里的数据
    public static void main(String[] args) {
        int i=1;
        f(i);
        System.out.println(i);//1

        int[] arr={1};
        f(arr);
        System.out.println(arr[0]);//2
    }

    public static void f(int i){
        i++;
    }

    public static void f(int[] i){
        i[0]++;
    }
}
